<?php
/* 
function get_image($data,$name){
	
$data = mb_convert_encoding($data, 'HTML-ENTITIES', "UTF-8"); 
$dom = new DOMDocument;
$dom->loadHTML($data);

$sxe = simplexml_import_dom($dom);

// grab all <a> nodes with an href attribute
$j=1;
foreach ($sxe->xpath('//img[@src]') as $a)
{	
    $link= $a['src'];
	$img=$dir."/".$j.".jpg";
	$imagel="http://localhost/gameavatar.net/upload/images/".$name."-".$j.".jpg";
	$result=file_put_contents("../upload/images/".$name."-".$j.".jpg",file_get_contents($link));
	$a['src']=$imagel;
	$j++;
}

$new_html = $dom->saveHTML();
return $new_html;
}

echo get_image($_POST['content'],$_POST['name']); */
?>